#include <bitelog.h>
#include <gflags/gflags.h>

// 1. 通过gflags定义要捕获的参数
DEFINE_bool(log_async, true, "是否启用异步日志");
DEFINE_int32(log_level, 1, "日志输出等级: 1-debug; 2-info; 3-warn; 4-err; 6-off");
DEFINE_string(log_format, "[%Y-%m-%d %H:%M:%S.%e] [%^%l%$] %v", "日志输出格式");
DEFINE_string(log_path, "stdout", "日志输出路径");

int main(int argc, char* argv[])
{
    // 2. 解析参数
    google::ParseCommandLineFlags(&argc, &argv, true);
    // 3. 设置日志器参数配置结构
    bitelog::log_settings settings = {
        .async = FLAGS_log_async,
        .level = FLAGS_log_level,
        .format = FLAGS_log_format,
        .path = FLAGS_log_path,
    };
    // 4. 初始化日志器
    bitelog::bitelog_init(settings);
    // 5. 输出日志
    DBG("hello world");
    return 0;
}